package com.briup.demo.service.impl;
import com.briup.demo.bean.Ware;
import com.briup.demo.dao.WareMapper;
import com.briup.demo.service.IWareService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class WareServiceImpl implements IWareService {
    @Resource
    private WareMapper wareMapper;
    @Override
    public List<Ware> findAll() {
        return  wareMapper.selectAll();
    }
    @Override
    public void saveOrUpdate(Ware ware) {
        if(ware.getId()!=null){
            wareMapper.update(ware);
        }
        else{
            wareMapper.insert(ware);
        }
    }
    @Override
    public void delete(Long id) {
        wareMapper.delete(id);

    }
}
